package com.example.dhhyc.demos.web.utils;

/**
 * Describe :
 * question :
 *
 * @auther BaiShanshan
 * @date 2024/4/13 8:39
 */

public class StringUtil {
    public static final String EMPTY = "";

    /**
     * 判断字符串是否为空
     *
     * @param str
     * @return
     */
    public static boolean isEmpty(String str) {
        return str == null || str.length() == 0;
    }

    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static String trim(String str) {
        return str == null ? null : str.trim();
    }

    public static String trimToEmpty(String str) {
        return str == null ? EMPTY : str.trim();
    }

}
